$(function(){
	/*查找昵称*/
	$("#find_nickname :button").click(function(){
		var nickname = $(this).prev(":input").val();
		if (!nickname) {
			alert("请输入昵称！");
			return false;
		}
		else {
			$.ajax({
				type: "POST",
				url: "php_ajax/find_name.php",
				dataType: "html",
				cache: "false",
				data: {u_name: nickname},
				success: function(data){
					$("#find_content").empty().html(data);
				}
			});
		}
	});
	
	/*查找真名*/
	$("#find_realname :button").click(function(){
		var realname = $(this).prev(":input").val();
		if (!realname) {
			alert("请输入名字！");
			return false;
		}
		else {
			$.ajax({
				type: "POST",
				url: "php_ajax/find_truename.php",
				dataType: "html",
				cache: "false",
				data: {u_truename: realname},
				success: function(data){
					$("#find_content").empty().html(data);
				}
			});
		}
	});
	
	/*查找邮箱*/
	$("#find_email :button").click(function(){
		var email = $(this).prev(":input").val();
		if (!email) {
			alert("请输入邮箱!");
			return false;
		}
		else {
			$.ajax({
				type: "POST",
				url: "php_ajax/find_email.php",
				dataType: "html",
				cache: "false",
				data: {u_email: email},
				success: function(data){
					$("#find_content").empty().html(data);
				}
			});
		}
	});
	
	/*查找学院*/
	$("#find_dept :button").click(function(){
		var dept = $(this).prev(":input").val();
		if (!dept) {
			alert("请输入学院名！");
			return false;
		}
		else {
			$.ajax({
				type: "POST",
				url: "php_ajax/find_dept.php",
				dataType: "html",
				cache: "false",
				data: {u_dept: dept},
				success: function(data){
					$("#find_content").empty().html(data);
				}
			});
		}
	});
	
});